$(function(){
	// 注册按钮
	 $("#btn-save-userinfo").click(function(){
		/* alert("ddddddddd");*/
	   var  userName = $('#userName').val();
	   if(userName==null || userName==''){
		  alert("请输入用户名");
		  return false;
	   }
	  
	   var password = $('#password').val();
	   if(password==null || password==''){
		   alert("请输入密码");
		   return false;
	   }
	   
	   var email = $('#email').val();
	   if(email==null || email==''){
		   alert("请输入邮箱");
		   return false;
	   }
	
	   var p={
			   userName:userName,
	           password:password,
	           email:email
	   };
		$.ajax({
			  type:"POST",
			  url:"/movie.front/userInfo/registUser",
			  data:JSON.stringify(p),
			  dataType:"json",
			  contentType:"application/json",
			  success:function(data){
	           if(data.result>0){
	        	   window.location.href="account.html";
	           }else{
	        	   alert("网络异常");
	           }
			  }
		
		   });

	  });

})